
import request from '@/common/http'
const scope = 'server'

export const loginByUsername = (username, password,code, randomStr,roleId) => {
  const grant_type = 'password'
  return request({
    url: '/auth/oauth/token',
    headers: {
      isToken:false,
      'Authorization': 'Basic cGlnOnBpZw=='
    },
    method: 'post',
    params: { username, password, randomStr,code,roleId, grant_type, scope }
  })
}

// export const refreshToken = (refresh_token) => {
//   const grant_type = 'refresh_token'
//   return request({
//     url: '/auth/oauth/token',
//     headers: {
//       'isToken': false,
//       'Authorization': 'Basic cGlnOnBpZw==',
//     },
//     method: 'post',
//     params: { refresh_token, grant_type, scope }
//   })
// }

// export const getUserInfo = () => {
//   return request({
//     url: '/admin/user/info',
//     method: 'get'
//   })
// }

// export const logout = () => {
//   return request({
//     url: '/auth/token/logout',
//     method: 'delete'
//   })
// }
